<?php
	$cn=$_GET['cn'];
	$matt=$_GET['matt'];
	include("../csdl.php");
	$knoi=new csdl();
	//echo "matt: ".$matt."<br>";
	//echo "fgdk".$cn;
	if($cn=='xoa')
	{
		$mahinh=$_GET['mahinh'];
		$knoi->queryCsdl("delete from hinhanh where mahinh='$mahinh'");
	}
	/*if($cn=='them')
	{
		$tam=basename( $_FILES['anh']['name']);
			echo "fgdk".$tam;
			$tam=explode("%",$tam);
			$tam=implode("",$tam);
			$tam=explode(" ",$tam);
			$tam=implode("",$tam);
			//echo "<br>".$_FILES['anh'.$i]['name'];
			$duongdan ="upload_images\\".$tam;
			if(@move_uploaded_file($_FILES['anh']['tmp_name'], $duongdan)) 
		   {
			  $result = $duongdan;
			  $knoi->queryCsdl("insert into hinhanh values('','$result','','$matt')");
		   }
	}*/
	$t=$knoi->queryCsdl("select mahinh,duongdan from hinhanh where matt='$matt'");
	$i=1;
				while($l=mysql_fetch_array($t))
				{
					if($i!=1)
					{
				?>
						<br><?php echo $i.". ".$l['duongdan']; ?>&nbsp;<img src="images/Sign-Error-icon1.png" border="0" class="class1" title="Xóa ảnh" onclick="xoaanh('anhkemtheo','<?php echo $matt; ?>','<?php echo $l['mahinh']; ?>','xoa')">
				<?php
					}
					else
					{	
				?>
						<?php echo $i.". ".$l['duongdan']; ?>&nbsp;<img src="images/Sign-Error-icon1.png" border="0" class="class1" title="Xóa ảnh" onclick="xoaanh('anhkemtheo','<?php echo $matt; ?>','<?php echo $l['mahinh']; ?>','xoa')">
				<?php
					}
						$i++;
				}
?>

